package cn.tedu.user.management.pojo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 检修记录表
 * @TableName maintain
 */
@TableName(value ="maintain")
@Data
public class Maintain implements Serializable {
    /**
     * 数据id
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 检修人
     */
    private Long userId;

    /**
     * 检修记录提交时间
     */
    private Date time;

    /**
     * 检修工具名称
     */
    private String toolName;

    /**
     * 检修工具编号
     */
    private String toolNumber;

    /**
     * 检修开始时间
     */
    private String durationStart;

    /**
     * 检修结束时间
     */
    private String durationEnd;

    /**
     * 检修时长
     */
    private Long duration;

    /**
     * 检修目标
     */
    private String target;

    /**
     * 检修内容
     */
    private String content;

    /**
     * 修改检修记录的时间
     */
    private String modificationTime;

    /**
     * 修改检修记录的次数
     */
    private Integer modificationFrequency;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Maintain other = (Maintain) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getTime() == null ? other.getTime() == null : this.getTime().equals(other.getTime()))
            && (this.getToolName() == null ? other.getToolName() == null : this.getToolName().equals(other.getToolName()))
            && (this.getToolNumber() == null ? other.getToolNumber() == null : this.getToolNumber().equals(other.getToolNumber()))
            && (this.getDurationStart() == null ? other.getDurationStart() == null : this.getDurationStart().equals(other.getDurationStart()))
            && (this.getDurationEnd() == null ? other.getDurationEnd() == null : this.getDurationEnd().equals(other.getDurationEnd()))
            && (this.getDuration() == null ? other.getDuration() == null : this.getDuration().equals(other.getDuration()))
            && (this.getTarget() == null ? other.getTarget() == null : this.getTarget().equals(other.getTarget()))
            && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
            && (this.getModificationTime() == null ? other.getModificationTime() == null : this.getModificationTime().equals(other.getModificationTime()))
            && (this.getModificationFrequency() == null ? other.getModificationFrequency() == null : this.getModificationFrequency().equals(other.getModificationFrequency()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getTime() == null) ? 0 : getTime().hashCode());
        result = prime * result + ((getToolName() == null) ? 0 : getToolName().hashCode());
        result = prime * result + ((getToolNumber() == null) ? 0 : getToolNumber().hashCode());
        result = prime * result + ((getDurationStart() == null) ? 0 : getDurationStart().hashCode());
        result = prime * result + ((getDurationEnd() == null) ? 0 : getDurationEnd().hashCode());
        result = prime * result + ((getDuration() == null) ? 0 : getDuration().hashCode());
        result = prime * result + ((getTarget() == null) ? 0 : getTarget().hashCode());
        result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
        result = prime * result + ((getModificationTime() == null) ? 0 : getModificationTime().hashCode());
        result = prime * result + ((getModificationFrequency() == null) ? 0 : getModificationFrequency().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userId=").append(userId);
        sb.append(", time=").append(time);
        sb.append(", toolName=").append(toolName);
        sb.append(", toolNumber=").append(toolNumber);
        sb.append(", durationStart=").append(durationStart);
        sb.append(", durationEnd=").append(durationEnd);
        sb.append(", duration=").append(duration);
        sb.append(", target=").append(target);
        sb.append(", content=").append(content);
        sb.append(", modificationTime=").append(modificationTime);
        sb.append(", modificationFrequency=").append(modificationFrequency);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}